package com.example.text.ui.mall.viewmodel

import androidx.lifecycle.MutableLiveData
import com.example.text.base.BaseViewModel
import com.example.text.base.state.Default
import com.example.text.base.state.Empty
import com.example.text.base.state.Failed
import com.example.text.base.state.Loading
import com.example.text.base.state.RequestEvent
import com.example.text.base.state.Success
import com.example.text.ui.mall.model.MallBanner
import com.example.text.ui.mall.model.MallMotorSeries
import com.example.text.ui.mall.repository.MallRepository
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import javax.inject.Inject

/** 商城首页相关 */
@HiltViewModel
class MallHomeViewModel @Inject constructor(
    private val mRepository: MallRepository
) : BaseMallViewModel(mRepository) {
    var currSeries: MallMotorSeries? = null

    var currSeriesName: String? = null

    fun requiredSeriesName(): String {
        val name = mSeriesGoods.value?.title
        return if (name.isNullOrEmpty()) {
            currSeriesName ?: ""
        } else {
            name
        }
    }
}
